<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta charset="UTF-8">
<title>主页</title>

<style type="text/css">
  #jiank{
          margin-right: 40px;
     }
</style>

<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>

<script type="text/javascript">
		$(function(){
			$("tr:even").css("background","#999");
			
			$("[bid]").click(function(){
				var bid=$(this).attr("bid");
				$.get("updateIsBorrowByid.do",{"bid":bid},function(r){
					alert(r.ret);
				},"json")
			})

			/*alert()
			$.ajax({
				type: "POST",
				url: "/collect/getCollect",
				data: {'userId':1},
				success: function(ret){
					alert()
				}
			});*/
		})
</script>

</head>
<body>
	<div style="width: 800px; margin: 0px auto;">
		<h2 style="margin: 0px auto;">图书借阅系统</h2>
		<form action="/collect/getCollect?userId=1" method="post" style="margin:20px 0px;">
			<br>
			图书分类:
			<select name="bootType" id="jiank">
				<option value="-1">--请选择--</option>
				<option value="0">--111--</option>
			</select>
			
			图书名称:
			<input type="text" id="jiank" name="bookName">
			
			是否借阅:
			<select id="jiank" name="isBorrow">
				<option value="-1">--请选择--</option>
				<option value="0" >--申请借阅--</option>
				<option value="1" >--已借阅--</option>
			</select>
			
			<input type="hidden" name="pageIndex" value="1">
			<input type="submit" value="查询" id="jiank">
		</form>
		
		<div style="float: right;margin-right: 60px;margin-bottom: 20px;">
			<!--当前用户:<span th:text="${session.userInfo.userName}"></span>-->&nbsp;&nbsp;&nbsp;&nbsp;<a href="#">退出</a>
		</div>
		
		<table width="750px" border="0.5">
		
			<tr>
			    <th>图书编号</th>
			    <th>图书分类</th>
			    <th>图书名称</th>
			    <th>作者</th>
			    <th>出版社</th>
			    <th>操作</th>
		 	</tr>
		 	

			<div id="collects" th:fragment="collects">
				<tr th:each="info:${collects}">
					<th th:text="${info['createDate']}"></th>
					<!--<th th:text="${info.book_code}"></th>
					<th th:text="${info.bookType.type_name}"></th>
					<th th:text="${info.book_name}"></th>
					<th th:text="${info.book_author}"></th>
					<th th:text="${info.publish_press}"></th>

					<th th:if="${info.is_borrow == 0}">
						<a href="#" id="jieyu" th:bid="${info.book_id}" style="color: red;">申请借阅</a>
					</th>
					<th th:if="${info.is_borrow == 1}">
							已借阅
					</th>-->
				</tr>
			</div>

		</table>
	</div>
</body>
</html>